package com.demo.config;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.dao.DataAccessException;
import org.springframework.data.redis.connection.RedisClusterConnection;
import org.springframework.data.redis.connection.RedisConnection;
import org.springframework.data.redis.connection.RedisConnectionFactory;
import org.springframework.data.redis.connection.RedisSentinelConnection;
import org.springframework.data.redis.connection.jedis.JedisConnectionFactory;
import org.springframework.data.redis.core.RedisTemplate;

/**
 * Create with Intellij idea
 * User:鲁智明
 * Date:2018/9/20
 * Time:22:46
 */

//这个类用配置redis服务器的连接
public class RedisConfig {

    @Autowired
    private RedisTemplate redisTemplate;

    @Value("${spring.redis.host}")
    String HostName;
    @Value("${spring.redis.port}")
    int Port;
    @Value("${spring.redis.password}")
    String password;

    public void set(){
        redisTemplate.opsForValue().set("lzm","123456");
    }

}
